$(document).ready(function (){	
	$("#menu_logout").click(function(){
		$.ajax({
			type:"GET",
			url:"index/logout",
			async:true,
			beforeSend:function loading(){
			},
			success:function(v){
				var data = window.JSON.parse(v);
				if(data.success){
					window.location.href = "login.html";
				}
			},
			error:function(){
			}
		});		
	});
	$("#menu_user").click(function(){
		$("#map-mainAlanStreet").hide();
		$("#map-northAlanStreet").hide();
		$("#map-eastAlanStreet").hide();
		$("#map_apartment").hide();
		$("#map_bookshop").hide();
		$("#map_park").hide();
		$("#map_school").hide();
		$("#map_payment").hide();
		$("#map_activity").hide();
		$("#map_account").show(2000);
		document.getElementById("account_name").innerHTML = userProfile.name;
		document.getElementById("account_accountname").innerHTML = userProfile.account.accountName;
		document.getElementById("account_accountnumber").innerHTML = userProfile.account.accountNumber;
		document.getElementById("account_points").innerHTML = userProfile.account.points;		
	});
	
	$("#menu_activities").click(function(){
		$("#map-mainAlanStreet").hide();
		$("#map-northAlanStreet").hide();
		$("#map-eastAlanStreet").hide();
		$("#map_apartment").hide();
		$("#map_bookshop").hide();
		$("#map_park").hide();
		$("#map_school").hide();
		$("#map_payment").hide();
		$("#map_account").hide();
		$("#map_activity").show(2000);
		var v = document.getElementById("isNew").value;
		if(v == 1) {
			document.getElementById("isNew").value = 0;
			document.getElementById("actNew").innerHTML = "";			
		}
		showActivityList();
	});
	$("#menu_items").click(function(){		
		window.location.href = "virtualgoods.html";				
	});
});